package com.zryc.shop.oms.controller;

import com.zryc.shop.base.Result;
import com.zryc.shop.oms.entity.OrderSetting;
import com.zryc.shop.oms.service.IOrderSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

/**
 * <p>
 * 订单设置表 前端控制器
 * </p>
 *
 * @author zhaozhao
 * @since 2024-01-18
 */
@RestController
@Api(tags = "订单默认超时设置")
@RequestMapping("/oms/orderSetting")
public class OrderSettingController {

    @Autowired
    private IOrderSettingService orderSettingService;

    @GetMapping("/{id}")
    @ApiOperation(("查询订单超时设置"))
    public Result info(@PathVariable Long id){
        return Result.ok(orderSettingService.getById(id));
    }

    @PostMapping("/update/{id}")
    @ApiOperation("修改订单超时设置")
    public Result update(@PathVariable Long id, @RequestBody OrderSetting orderSetting) {
        return Result.ok(orderSettingService.updateTimeOrder(id,orderSetting));
    }

}
